home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / video / zapem-0.000 / zapem-0 / zapem / animation.h < prev    next >
C/C++ Source or Header  |  1995-05-06  |  1KB  |  63 lines

  1. /*    
  2.     Defines the animation property as an abstract class, 
  3.     i.e. they can be declared though!    
  4. */
  5.  
  6. #ifndef ANIMATION_H
  7. #define ANIMATION_H
  8.  
  9. #include <SLList.h>
  10. #include "btypes.h"
  11. #include <iostream.h>
  12.  
  13. const int MAXSPRITE=64;
  14. const int MAXFRAME=256;
  15. const int LOOPANIM=1024;
  16. const int VANISHANIM=1025;
  17.  
  18. struct slotElt{
  19.     byte* block;
  20.     byte* mask;
  21.     uint32 width, height, ByteLength;
  22. };
  23.  
  24. struct animElt{
  25. public:
  26.     int slot;
  27.     int duration;
  28. };
  29.  
  30. typedef SLList<struct animElt> animList; 
  31.  
  32. struct animElt animElt(int s, int d); 
  33. animList operator+(animList l,struct animElt a);
  34. animList operator+(struct animElt a, struct animElt b);
  35.  
  36. class
  37. Animation
  38. {
  39. private:
  40.         virtual void setVisible( bool v){cerr << "SHOULD NEVER BE CALLED\n";}
  41.     Pix curframe;
  42.     bool animflag;
  43. protected:
  44.     static slotElt sprbank[MAXFRAME]; 
  45.     animList anim;
  46.     int curslot, framecounter;
  47.     void doAnim(void);
  48.     void setFrame(Pix f){curframe=f;}
  49. public:
  50.     Animation();
  51.     Animation(const Animation& a);
  52.     Animation& operator=(const Animation& a);
  53.  
  54.     void loadFilm( animList a);
  55.     bool getAnim(void) const {return animflag;}
  56.     int getSlot(void) const {return curslot;}
  57.  
  58.     void setAnim(bool a);
  59.     virtual void setSlot(int slot);
  60. };
  61.  
  62. #endif
  63.